home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Music⁄Sounds / BeepSay 1.0.1 / ShowInit.a < prev    next >
Encoding:
Text File  |  1993-05-19  |  15.5 KB  |  539 lines  |  [TEXT/MPS ]

  1. ; File: ShowINIT.a
  2. ; Last Modified: Sunday, November 26, 1989 05:07:56 PM
  3. ;------------------------------------------------------------------------------------------------
  4. ;
  5. ;    INIT notification routine
  6. ;     by Paul Mercer, Darin Adler, Paul Snively,
  7. ;        Frédéric Miserey, and Alex Rosenberg from an idea by Steve Capps
  8. ;
  9. ;    Created:  6/7/87  PM    - First version.
  10. ;    Modified: 6/15/87 PM    - Changed to standard (Pascal) calling conventions.
  11. ;          6/20/87 PM    - Fixed color & Finder bug on Mac II.
  12. ;          6/22/87 DBA    - Improved handling of QuickDraw.
  13. ;          6/29/87 DBA    - Used scratch8 to avoid conflict with “Easy Access”.
  14. ;          6/30/87 DBA    - Changed to a 4-byte scheme with “checksum”.
  15. ;          6/30/87 PFS    - Separated into ShowINIT and InnerShowINIT.
  16. ;          7/1/87  DBA    - Fixed stack bug and switched to CurApName+.
  17. ;          7/2/87  PM    - Added check for old signature in ApplScratch for
  18. ;                   backword compatibility (TMON Startup).
  19. ;          7/3/87  PM    - Removed _SysBeep in ErrorExit since it causes a crash.
  20. ;                   Also changed ICN# plotter to srcOr mode for Blinker.
  21. ;          7/13/87 PM    - Fixed a3 trashing bug in InnerShowINIT - exit code left
  22. ;                   word on stack (reported by D. Dunham).
  23. ;          7/21/87 PM    - Due to popular demand, InitGraf is no longer being called.
  24. ;                   This avoids the gamma correction problem with Startupscreens
  25. ;                   getting  “washed out” by ShowINIT though someone else is still
  26. ;                   bound to call InitGraf sooner or later (i.e. InitWindows).
  27. ;          7/29/87 PM    - Put InitGraf back in; this is required (reported by C. Derossi
  28. ;                   at Apple Tech Support).  Took out GetPort/SetPort.
  29. ;        10/06/87  PM    - Set CurrentA5 properly.  Rearranged myVars.
  30. ;        12/28/87  PM    - Major revision to accomodate future INIT31 based ShowINIT.
  31. ;        07/14/88  PM    - Major revision to get rid of above 'accomodations'.
  32. ;                   Added color icon 'cicn' support and fixed beep crash.
  33. ;                   Removed support for old signature.
  34. ;        11/25/89 FCM    - Added Y dimension support, icl48 support to get rid of 'obsolete' cicns
  35. ;        3/27/90  AMR    - 'cicn's were not being drawn in their native size.
  36. ;
  37. ;------------------------------------------------------------------------------------------------
  38.  
  39.         INCLUDE    'Traps.a'
  40.         INCLUDE    'QuickEqu.a'
  41.         INCLUDE    'SysEqu.a'
  42.         INCLUDE    'ToolEqu.a'
  43.  
  44.         BLANKS  ON
  45.         STRING  ASIS
  46.  
  47. True        equ    1
  48. False        equ    0
  49.  
  50. Debug        equ    True
  51. ;Debug        equ    False
  52.  
  53. myVCheck    equ    CurApName+32-8        ; a GREAT place to store 8 bytes (it was Darin's idea)
  54. myV        equ    myVCheck+2
  55. myH        equ    myV+2
  56. myHCheck    equ    myH+2            ; a simple checksum of myH to determine first-timeness
  57. firstX        equ    8            ; X coordinate of first icon to be drawn
  58. bottomEdge    equ    8+32            ; this far from bottom of screen
  59. iconWidth    equ    32            ; size of icon (square normally)
  60. visBuff        equ    8            ; a visual buffer between icons of 8 pixels
  61. defaultMoveX    equ    iconWidth+visBuff    ; x default amount to move icons (40 pixels)
  62. defaultMoveY    equ    40            ; y icon line height
  63. checksumConst    equ    $1021            ; constant used for computing checksum
  64. minColorDepth    equ    4            ; minimum bits/pixel for drawing color icons
  65.  
  66. maskOffset    equ    128            ; offset to mask in ICN#
  67. iconRowBytes    equ    32/8            ; 32/8 bits
  68.  
  69. hasCQDBit    equ    6            ; this bit in ROM85 is cleared if Color QuickDraw is available
  70.  
  71. iconID        equ    6+4            ; positive stackframe objects
  72. moveX        equ    4+4
  73. showINITArgs    equ    4
  74.  
  75. iconPtrHdl    equ    6+4
  76. initDrawArgs    equ    6
  77.  
  78. iclPtrHdl    equ    12+4
  79. iclDepth    equ    10+4
  80. initDrawXArgs    equ    initDrawArgs+6
  81.  
  82. myVars        RECORD    0,DECREMENT
  83. saveA5        ds.l    1
  84. localA5        ds.l    1
  85. thePort        ds.l    1            ; my own QuickDraw (required!)
  86.         ds.b    grafSize-4        ;  other QuickDraw globals (except thePort)
  87. destRect    ds.w    4
  88. currMoveX    ds.w    1            ; holds current moveX value
  89. myBitMap    ds.b    bitMapRec
  90. myPort        ds.b    portRec
  91. varsSize    equ    *
  92.         ENDR
  93.  
  94.  
  95. ;------------------------------------------------------------------------------------------------
  96. ;
  97. ;    Displays the ICN# (cicn when in 4 bit mode or higher) specified by iconID and
  98. ;     move the pen horizontally by moveX.
  99. ;    Pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  100. ;
  101. ;    PROCEDURE ShowINIT(iconID: Integer; moveX: Integer); EXTERNAL
  102. ;
  103. ;    pascal void ShowINIT(iconID, moveX)
  104. ;        short iconID, moveX;
  105. ;        extern;
  106. ;
  107. ;------------------------------------------------------------------------------------------------
  108. ShowINIT:    PROC    EXPORT
  109.         IMPORT    INITDraw1Bit, INITDrawCQD,INITDrawXBit
  110.  
  111.         link    a6,#0            ; create stack frame
  112.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  113.  
  114.         btst.b    #hasCQDBit,ROM85    ; try to get a color icon if CQD exists
  115.         beq.s    ShowINITCQD        ; I could use SysEnvirons but I don't want to
  116. ShowINIT1Bit
  117.         subq.w    #4,sp            ; try to get the icon resource
  118.         move.l    #'ICN#',-(sp)
  119.         move.w    iconID(a6),-(sp)
  120.         _GetResource
  121.         move.l    (sp)+,d0
  122.         beq.s    ShowINITError        ; can't get it, give up
  123.  
  124.         move.l    d0,-(sp)        ; leave handle on the stack for ReleaseResource
  125.         move.l    d0,a0
  126.         _HLock
  127.         move.l    (a0),a0            ; dereference
  128.         move.l    a0,-(sp)        ; icon pointer
  129.         move.w    moveX(a6),-(sp)        ; moveX
  130.         bsr    INITDraw1Bit        ; draw
  131.         _ReleaseResource        ; release the resource
  132.  
  133. ShowINITExit:
  134.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  135.         unlk    a6            ; ditch stack frame
  136.         move.l    (sp)+,a0        ; get return address
  137.         addq.l    #showINITArgs,sp    ; ditch incoming arguments
  138.         jmp    (a0)            ; return to caller
  139.  
  140. ShowINITError:
  141.         IF    Debug THEN
  142.         move.w    #1,-(sp)        ; just beep
  143.         _SysBeep
  144.         ENDIF
  145.         bra.s    ShowINITExit
  146.  
  147.  
  148. ShowINITCQD:    
  149.         move.l    #$40008,d2
  150.         move.l    #'icl8',d3
  151.         move.l    #'icl4',d4
  152.         move.l    MainDevice,a0        ; get handle to main device
  153.         move.l    (a0),a0            ; dereference
  154.         move.l    gdPMap(a0),a0        ; get its pixmap handle
  155.         move.l    (a0),a0            ; dereference it
  156.         cmp.w    #minColorDepth,pmPixelSize(a0)    ; is it deep enough for us to draw in color?
  157.         blt.s    ShowINIT1Bit            ;  no
  158.         bne.s    noSwapOrder            ; is depth 4 ?
  159.         swap    d2                ; yes - swap icl_ search order
  160.         exg    d3,d4
  161. noSwapOrder:
  162.         subq.w    #4,sp
  163.         move.l    d3,-(sp)
  164.         move.w    iconID(a6),-(sp)
  165.         _GetResource
  166.         move.l    (sp)+,d1
  167.         beq.s    SearchNext
  168. FoundIc:
  169.         subq.w    #4,sp
  170.         move.l    #'ICN#',-(sp)
  171.         move.w    iconID(a6),-(sp)
  172.         _GetResource
  173.         move.l    (sp)+,d0
  174.         bne.s    FoundCompanion
  175.         
  176.         move.l    d1,-(sp)
  177.         _ReleaseResource
  178.         bra.s    ShowINITError
  179. FoundCompanion:        
  180.         move.l    d1,-(sp)        ; leave handle on the stack for ReleaseResource
  181.         move.l    d0,-(sp)        ; leave handle on the stack for ReleaseResource
  182.         move.l    d0,d3
  183.         
  184.         move.l    d1,a0
  185.         _HLock
  186.         move.l    (a0),a0            ; dereference
  187.         move.l    a0,-(sp)        ; icl_ pointer
  188.         move.w    d2,-(sp)        ; icl_ depth
  189.         move.l    d3,a0
  190.         _HLock
  191.         move.l    (a0),a0            ; dereference
  192.         move.l    a0,-(sp)        ; icon pointer
  193.         move.w    moveX(a6),-(sp)        ; moveX
  194.         bsr    INITDrawXBit        ; draw
  195.         _ReleaseResource        ; release the resource
  196.         _ReleaseResource        ; release the resource
  197.         bra    ShowINITExit
  198. SearchNext:
  199.         swap    d2
  200.         subq.w    #4,sp
  201.         move.l    d4,-(sp)
  202.         move.w    iconID(a6),-(sp)
  203.         _GetResource
  204.         move.l    (sp)+,d1
  205.         bne.s    FoundIc
  206.  
  207.         subq.w    #4,sp            ; can a color icon be found?
  208.         move.w    iconID(a6),-(sp)
  209.         _GetCIcon
  210.         move.l    (sp)+,d0
  211.         beq    ShowINIT1Bit        ;  no, so try for regular icon
  212.  
  213.         move.l    d0,-(sp)        ; leave handle on the stack for DisposCIcon
  214.         move.l    d0,-(sp)        ; cicn handle
  215.         move.w    moveX(a6),-(sp)        ; moveX
  216.         bsr    INITDrawCQD        ; do the actual drawing
  217.         _DisposCIcon
  218.  
  219.         bra    ShowINITExit
  220.  
  221. ShowINITCredits:
  222.         dc.w    'ShowINIT by Paul Mercer'
  223.         dc.w    'Copyright 1987-1990'
  224.         dc.w    'Version of 03/27/90'
  225.         ENDPROC
  226.  
  227.  
  228. ;------------------------------------------------------------------------------------------------
  229. ;
  230. ;    Initializes the world and sets up the drawing rectangle
  231. ;
  232. ;------------------------------------------------------------------------------------------------
  233. INITInit:    PROC    EXPORT
  234.         WITH    myVars
  235.  
  236.         move.l    CurrentA5,saveA5(a6)    ; PM 10/6 save host A5
  237.         lea    localA5(a6),a5        ; PM7/21
  238.         move.l    a5,CurrentA5
  239.         pea    thePort(a6)        ; PM 10/6 use a5 reference instead of a6
  240.         _InitGraf            ; fixes color bug as per DA@ICOM
  241.         pea    myPort(a6)
  242.         _OpenPort
  243.  
  244.         move.w    myV,d0            ; get my v var
  245.         rol.w    #1,d0            ; compare against checksum
  246.         eor.w    #checksumConst,d0
  247.         cmp.w    myVCheck,d0
  248.         beq.s    ScratchVOK        ; checks, so go on test my h var
  249.  
  250.         move    myPort+portBounds+bottom(a6),d0 ; else initialize as first time
  251.         sub.w    #bottomEdge,d0
  252.         move    d0,myV
  253. ScratchVOK:
  254.         move.w    myH,d0            ; get my h var
  255.         rol.w    #1,d0            ; compare against checksum
  256.         eor.w    #checksumConst,d0
  257.         cmp.w    myHCheck,d0
  258.         beq.s    ScratchHOK        ; checks, so go on
  259.         move    #firstX,myH        ; else initialize as first time
  260. ScratchHOK:
  261.         move.l    myV,d0
  262.  
  263.         move.w    d0,d1            ; get future position
  264.         add.w    #iconWidth,d1        ; compute future rect right
  265.         cmp.w    myPort+portBounds+right(A6),d1 ; compare to main screen right
  266.         blt.s    DontChangeLine        ; smaller - do nothing
  267.  
  268.         move.w    myV,d0            ; decrement Y value
  269.         subi.w    #defaultMoveY,d0
  270.         move.w    d0,myV
  271.         moveq    #firstX,D0
  272.         move    d0,myH            ; set X to initial value
  273.  
  274.         move.l    myV,d0
  275. DontChangeLine:
  276.         move.l    d0,destRect(a6)
  277.         move.l    d0,destRect+botRight(a6)
  278.         add.w    #iconWidth,destRect+right(a6)
  279.         add.w    #iconWidth,destRect+bottom(a6)
  280.  
  281.         move.w    #defaultMoveX,currMoveX(a6)    ; establish a default
  282.                             ; INITDrawCQD changes this
  283.         rts
  284.  
  285.         ENDWITH
  286.         ENDPROC
  287.  
  288.  
  289. ;------------------------------------------------------------------------------------------------
  290. ;
  291. ;    Cleans up the work done by INITInit and advances the icon drawing position
  292. ;
  293. ;------------------------------------------------------------------------------------------------
  294. INITCleanup:    PROC    EXPORT
  295.         WITH    myVars
  296.  
  297.         move.w    myH,d0            ; get current position
  298.         move.w    moveX(a6),d1        ; get delta x
  299.         bpl.s    NotDefault        ; not default (-1)
  300.         move.w    currMoveX(a6),d1    ; default - set in INITInit and INITDrawCQD
  301. NotDefault:
  302.         add.w    d1,d0            ; increment icon position
  303.         move.w    d0,myH            ;  and save in ‘global’
  304. computeChecksum:
  305.         rol.w    #1,d0            ; recompute h checksum
  306.         eor.w    #checksumConst,d0
  307.         move.w    d0,myHCheck        ;  and save it
  308.  
  309.         move    myV,d0            ; same for v checksum
  310.         rol.w    #1,d0
  311.         eor.w    #checksumConst,d0
  312.         move.w    d0,myVCheck
  313. Exit:
  314.         pea    myPort(a6)
  315.         _ClosePort
  316.         ; *** (DBA) I think that QuickDraw leaves handles around.
  317.         ; *** (DBA) Too bad we can't get rid of them...
  318.         move.l    saveA5(a6),a5        ; PM 10/6 restore host A5
  319.         move.l    a5,CurrentA5
  320.         rts
  321.  
  322.         ENDWITH
  323.         ENDPROC
  324.  
  325.  
  326. ;------------------------------------------------------------------------------------------------
  327. ;
  328. ;    display the ICN# pointed to by iconPtr and move the pen horizontally by moveX
  329. ;     pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  330. ;
  331. ;    PROCEDURE INITDraw1Bit(iconPtr: ICONListPtr; moveX: Integer); EXTERNAL
  332. ;
  333. ;    pascal void INITDraw1Bit(iconPtr, moveX)
  334. ;        ICONList *iconPtr;
  335. ;        short moveX;
  336. ;        extern;
  337. ;
  338. ;------------------------------------------------------------------------------------------------
  339. INITDraw1Bit:    PROC    EXPORT
  340.         IMPORT    INITInit, INITCleanup:CODE
  341.         WITH    myVars
  342.  
  343.         link    a6,#varsSize        ; create stack frame
  344.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  345.         bsr    INITInit        ; initialize for drawing
  346.  
  347.         move.l    iconPtrHdl(a6),a3    ; get ICN# pointer
  348.         lea    myBitMap(a6),a4        ; point to bitmap structure
  349.         move.l    a3,baseAddr(a4)        ; fill it out
  350.         add.l    #maskOffset,baseAddr(a4) ; skip to mask
  351.         move    #iconRowBytes,rowBytes(a4)
  352.         moveq    #0,d0
  353.         move.l    d0,bounds(a4)        ; 0,0 topleft
  354.         move.l    #(iconWidth<<16)+iconWidth,bounds+bottom(a4) ; 32,32 botright
  355.         
  356.         move.l    a4,-(sp)        ; punch hole with mask
  357.         lea    myPort(a6),a2        ; get the desk port
  358.         pea    portBits(a2)        ;  for its portbits
  359.         pea    srcRect
  360.         pea    destRect(a6)
  361.         move    #srcBic,-(sp)        ; punch a hole
  362.         clr.l    -(sp)            ; no clip region
  363.         _CopyBits
  364.  
  365.         sub.l    #128,baseAddr(a4)
  366.         move.l    a4,-(sp)        ; now draw (or) icon
  367.         pea    portBits(a2)
  368.         pea    srcRect
  369.         pea    destRect(a6)
  370.         move    #srcOr,-(sp)
  371.         clr.l    -(sp)
  372.         _CopyBits
  373.  
  374.         bsr    INITCleanup        ; cleanup, advance icon location
  375.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  376.         unlk    a6            ; ditch stack frame
  377.         move.l    (sp)+,a0        ; get return address
  378.         addq.l    #initDrawArgs,sp    ; ditch incoming
  379.         jmp    (a0)            ; back to caller
  380.  
  381. srcRect:    dc.w    0,0,32,32        ; for copybits
  382.  
  383.         ENDWITH
  384.         ENDPROC
  385.  
  386.  
  387. ;------------------------------------------------------------------------------------------------
  388. ;
  389. ;    display the Icl pointed to by iclPtr and move the pen horizontally by moveX
  390. ;     pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  391. ;
  392. ;    PROCEDURE INITDrawXBit(iclPtr: icl_Ptr; iclDepth: Integer; 
  393. ;                iconPtr: ICONListPtr; moveX: Integer); EXTERNAL
  394. ;
  395. ;    pascal void INITDrawXBit(iconPtr, moveX)
  396. ;        icl_Ptr *iclPtr;
  397. ;        short iclDepth;
  398. ;        ICONList *iconPtr;
  399. ;        short moveX;
  400. ;        extern;
  401. ;
  402. ;------------------------------------------------------------------------------------------------
  403. INITDrawXBit:    PROC    EXPORT
  404.         IMPORT    INITInit, INITCleanup:CODE
  405.         WITH    myVars
  406.  
  407.         
  408.         link    a6,#varsSize        ; create stack frame
  409.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  410.         
  411.         subq.w    #4,sp
  412.         _NewPixMap
  413.         move.l    (sp)+,d0
  414.         bne.s    pixIsGood
  415.         
  416.         move.l    iconPtrHdl(a6),-(sp)
  417.         move    moveX(a6),-(sp)
  418.         bsr    INITDraw1Bit
  419.         bra    quickEnd
  420. pixIsGood:    
  421.         move.l    d0,a2
  422.         
  423.         bsr    INITInit        ; initialize for drawing
  424.  
  425.         movea.l    a2,a0
  426.         _HLock
  427.         movea.l    (a2),a0
  428.         movea.l    pmTable(a0),a0
  429.         _DisposHandle
  430.         subq.w    #4,sp
  431.         move.l    #'clut',-(sp)
  432.         move.w    iclDepth(a6),-(sp)
  433.         _RGetResource
  434.         movea.l    (a2),a0
  435.         move.l    (sp)+,pmTable(a0)
  436.         
  437.         move.l    iclPtrHdl(a6),pmBaseAddr(a0)
  438.         moveq    #iconRowBytes,d0
  439.         move.w    iclDepth(a6),d1
  440.         mulu    d1,d0
  441.         bset.l    #15,d0
  442.         move.w    d0,pmRowBytes(a0)
  443.         moveq    #0,d0
  444.         move.l    d0,pmBounds(a0)        ; 0,0 topleft
  445.         move.l    #(iconWidth<<16)+iconWidth,pmBounds+bottom(a0) ; 32,32 botright
  446.         move.w    #chunky,pmPixelType(a0)
  447.         move.w    d1,pmPixelSize(a0)
  448.         move.w    #1,pmCmpCount(a0)
  449.         move.w    d1,pmCmpSize(a0)
  450.         
  451.         lea    myBitMap(a6),a4        ; point to bitmap structure
  452.         move.l    iconPtrHdl(a6),baseAddr(a4) ; fill it out with ICN# pointer
  453.         add.l    #maskOffset,baseAddr(a4) ; skip to mask
  454.         move    #iconRowBytes,rowBytes(a4)
  455.         moveq    #0,d0
  456.         move.l    d0,bounds(a4)        ; 0,0 topleft
  457.         move.l    #(iconWidth<<16)+iconWidth,bounds+bottom(a4) ; 32,32 botright
  458.         
  459.         move.l    (a2),d0
  460.         move.l    d0,-(sp)
  461.         move.l    a4,-(sp)        ; punch hole with mask
  462.         pea    myPort+portBits(a6)    ; get the desk port portbits
  463.         pea    srcRect
  464.         pea    srcRect
  465.         pea    destRect(a6)
  466.         _CopyMask
  467.         
  468.         moveq    #0,d0
  469.         _NewHandle
  470.         movea.l    (a2),a1
  471.         move.l    a0,pmTable(a1)
  472.         move.l    a2,-(sp)
  473.         _DisposPixMap
  474.  
  475.         bsr    INITCleanup        ; cleanup, advance icon location
  476. quickEnd    movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  477.         unlk    a6            ; ditch stack frame
  478.         move.l    (sp)+,a0        ; get return address
  479.         adda.w    #initDrawXArgs,sp    ; ditch incoming
  480.         jmp    (a0)            ; back to caller
  481.  
  482. srcRect:    dc.w    0,0,iconWidth,iconWidth    ; for copymask
  483.  
  484.         ENDWITH
  485.         ENDPROC
  486.  
  487.  
  488. ;------------------------------------------------------------------------------------------------
  489. ;    same as above except with color icon handle
  490. ;------------------------------------------------------------------------------------------------
  491. INITDrawCQD:    PROC    EXPORT
  492.         IMPORT    INITInit, INITCleanup:CODE
  493.         WITH    myVars
  494.  
  495.         link    a6,#varsSize        ; create stack frame
  496.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  497.         bsr    INITInit        ; initialize for drawing
  498.  
  499.         move.l    iconPtrHdl(a6),a0
  500.         move.l    (a0),a0
  501.         move.w    pmBounds+right(a0),d0    ; (right - left - iconWidth) + destRect.right
  502.         move.w    pmBounds+left(a0),d1
  503.         sub.w    d1,d0
  504.         
  505.         move.w    #visBuff,d1
  506.         move.w    d0,currMoveX(a6)
  507.         add.w    d1,currMoveX(a6)    ; (right - left) -> currMoveX
  508.         
  509.         move.w    #iconWidth,d1
  510.         subx.w    d1,d0
  511.         move.w    destRect+right(a6),d1
  512.         addx.w    d0,d1
  513.         move.w    d1,destRect+right(a6)
  514.         move.w    pmBounds+bottom(a0),d0    ; (bottom - top - iconWidth) + destRect.bottom
  515.         move.w    pmBounds+top(a0),d1
  516.         sub.w    d1,d0
  517.         move.w    #iconWidth,d1
  518.         subx.w    d1,d0
  519.         move.w    destRect+bottom(a6),d1
  520.         addx.w    d0,d1
  521.         move.w    d1,destRect+bottom(a6)
  522.  
  523.         pea    destRect(a6)        ; destination rect
  524.         move.l    iconPtrHdl(a6),-(sp)    ; cicn handle
  525.         _PlotCIcon            ; draw it
  526.  
  527.         bsr    INITCleanup        ; cleanup, advance icon location
  528.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  529.         unlk    a6            ; ditch stack frame
  530.         move.l    (sp)+,a0        ; get return address
  531.         addq.l    #initDrawArgs,sp    ; ditch incoming
  532.         jmp    (a0)            ; back to caller
  533.  
  534.         ENDWITH
  535.         ENDPROC
  536.  
  537.  
  538.         END
  539.